package com.vnie.mina.test;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

import com.vnie.mina.message.BaseMessage;



public class ByteCodecServerFactory implements ProtocolCodecFactory {

    private ProtocolEncoder encoder;  
    private ProtocolDecoder decoder;  

    public ByteCodecServerFactory(BaseMessage receiverMessage) {  
         encoder = new ByteRequestServerEncoder();  
         decoder = new ByteRequestServerDecoder(receiverMessage);  
    }  

     public ProtocolEncoder getEncoder(IoSession ioSession) throws Exception {  
       return encoder;  
     }  

     public ProtocolDecoder getDecoder(IoSession ioSession) throws Exception {  
       return decoder;  
     }

}
